<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <script type="text/javascript">
        // 假设服务端ip为127.0.0.1
        ws = new WebSocket("ws://127.0.0.1:8282");
        ws.onopen = function() {
            console.log("连接成功");
        };
        ws.onmessage = function(e) {
            console.log("收到服务端的消息：" + e.data);
        };
    </script>
</head>
<body>
</body>
</html>